package action.agent;

import org.apache.struts2.ServletActionContext;

import service.interf.IIfwServerDate;
import action.common.MyBaseAction;

import com.opensymphony.xwork2.ModelDriven;

import dao.pojo.IfwServerDate;

/**
 * 系统时间配置
 * 
 * @author Administrator
 * 
 */
public class IfwServerDateAction extends MyBaseAction<IfwServerDate> implements
		ModelDriven<IfwServerDate> {

	private static final long serialVersionUID = 1L;
	private IIfwServerDate iIfwServerDate;

	public void setiIfwServerDate(IIfwServerDate iIfwServerDate) {
		this.iIfwServerDate = iIfwServerDate;
	}

	public IfwServerDateAction() {
		super(IfwServerDate.class);
	}

	public IfwServerDate getModel() {
		return model;
	}

	/**
	 * 初始化列表
	 */
	public void get() {
		String r;
		try {
			r = iIfwServerDate.get();
		} catch (Exception e) {
			r = errorHandle.handleErr(e);
		}
		servletHandle.writeToClient1(ServletActionContext.getResponse(), r);
	}

	/**
	 * 修改
	 */
	public void edit() {
		String r;
		try {
			r = iIfwServerDate.edit(model.getCurTime());
		} catch (Exception e) {
			r = errorHandle.handleErr(e);
		}
		servletHandle.writeToClient1(ServletActionContext.getResponse(), r);
	}

}
